package com.two.zelin.service.impl;
//订单服务层
import java.util.List;


import com.two.zelin.dao.orderDao;
import com.two.zelin.dao.impl.orderDaoImpl;
import com.two.zelin.model.order;
import com.two.zelin.service.orderService;

public class orderServiceImpl implements orderService{
	
	@Override
	/**查询所有订单服务层实现*/
	public List<order> selectAll() {
		orderDao dao = new orderDaoImpl();
		return  dao.selectAll();
	}
	
	/**添加订单服务层实现*/
	@Override
	public boolean addorder(String fukuan,String spname,String spid,String jage,String zhekou,String shouhuo) {
		orderDaoImpl dao = new orderDaoImpl();
		int a = Integer.valueOf(jage);
		int n = dao.addorder(fukuan, spname, spid, a, zhekou,shouhuo);
		return n>0;
	}
	
	
	/**根据订单id查询订单信息*/
	@Override
	public order selectById(String id) {
		orderDao dao = new orderDaoImpl();
		int no = Integer.valueOf(id);
		return dao.selectById(no);
	}
	
	
	/**更新订单服务层实现*/
	@Override
	public boolean updateorder(String id, String spid,String fukuan,String spname,String jage,String zhekou,String shouhuo) {
		orderDao dao = new orderDaoImpl();
		int a = Integer.valueOf(jage);
		int i = Integer.valueOf(id);
		int n = dao.updateorder(i, spid, fukuan,spname, a, zhekou, shouhuo);
		return n>0;
	}
	
	
	/**删除订单服务层实现*/
	@Override
	public boolean deleteorder(String id) {
		orderDao dao = new orderDaoImpl();
		int i = Integer.valueOf(id);
		int n = dao.deleteorder(i);
		return n>0;
	}

}
